Refactor provider adapter registration - #8335
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The Copilot test must verify that the injected provider-specific transform receives the body.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Centralizes provider adapter registration while preserving provider order and transform wiring.
Changes:
- Adds an ordered provider factory registry.
- Builds adapters through the shared registry.
- Adds ordering and transform-wiring tests.
File summaries
| File | Description |
|---|---|
containers/api-proxy/providers/index.js |
Defines and consumes the shared adapter registry. |
containers/api-proxy/providers/index.test.js |
Tests ordering and transform wiring, but does not verify the injected Copilot transform is invoked. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
✅ Copilot review passed with no inline comments. @copilot Add the |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
|
❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...
|
|
❌ Smoke Gemini reports failed. Facets need polishing...
|
|
✅ Build Test Suite completed successfully!
|
|
✅ Smoke Claude passed Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.
|
|
✅ Security Guard completed successfully! Security review complete: PR #8335 refactors provider adapter registration in containers/api-proxy/providers/index.js. No security-weakening changes detected. The refactoring consolidates duplicate instantiation code into a centralized PROVIDER_ADAPTER_FACTORIES array and uses .map() for adapter creation. This maintains the same dependency injection pattern, null handling, and credential isolation. No capabilities added, firewall rules changed, or secrets exposed. The change is purely a code-quality improvement with identical security properties.
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
📰 DEVELOPING STORY: Smoke Docker Sbx reports failed. Our correspondents are investigating the incident...
|
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...
|
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅
|
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "msfeed25.pkgs.visualstudio.com"See Network Configuration for more information.
|
|
✅ MCP connectivity (PR #8351: chore(deps): upgrade gh-aw to v0.88.8) Overall: PASS
|
Smoke Test: Claude Engine Validation
Overall result: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (github.com) reachable: Overall: PASS cc Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
Smoke Test: Services Connectivity
Overall: PASS
|
|
✅ GitHub MCP: PR listings verified Status: PASS | Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY)
|
Chroot Version Comparison Results
Overall: FAILED — Node.js version mismatch between host and chroot environments.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Notes:
|
📡 OTel Tracing Smoke Test Results
Overall: all scenarios pass, no regressions detected.
|
|
Smoke test: FAIL
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "msfeed25.pkgs.visualstudio.com"See Network Configuration for more information.
|
Provider registration repeated identical adapter creation and body-transform wiring for each provider. This centralizes the ordered registration definition while preserving provider order and behavior.
Registry
PROVIDER_ADAPTER_FACTORIEStable pairing each factory with its transform dependency key.Coverage